UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hDBdDIU6tOQc9cMMEc/zwH+7RUe9+zIhz0NCie7zrGY='
WHERE
key_id = 'e3c92d4fb6c0a0321371c23f6cef7557cf3499f6ff62c8e46ee38e2757e5bf12'
AND (
token = 'hDBdDIU6tOQc9cMMEc/zwH+7RUe9+zIhz0NCie7zrGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)