UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uuvhRGpT7DwBHDUNucru8E0Utj8uBv2TUq5fyb2yfaE='
WHERE
key_id = 'dd2605920c7f7d07ee72171d2a2b3eb414895cd47f9191093c01ce17edb3bc5d'
AND (
token = 'uuvhRGpT7DwBHDUNucru8E0Utj8uBv2TUq5fyb2yfaE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)