UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '60yur6t+l8bA+jTJaI21oGPNTC6X0KXzAW06mVEyTj0='
WHERE
key_id = 'e4e570c892d7625e58362bd98e4c382c72d28e3e15e887422b89b23b2186443f'
AND (
token = '60yur6t+l8bA+jTJaI21oGPNTC6X0KXzAW06mVEyTj0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)