UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f0sMLmjKEvYDPoIutHVuXmTe/nETqXT59Cp42bzonpc='
WHERE
key_id = '33ea0eb8217afe3646b8d561f0d42c2734deb42eceed0a5c77a7101c3860a305'
AND (
token = 'f0sMLmjKEvYDPoIutHVuXmTe/nETqXT59Cp42bzonpc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)