UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/8GCzbAxY8WMNuUnlL+FqJRQUt1bieSnUQ+wRXn/ofU='
WHERE
key_id = '3e51632586393781353ad98f8175e526a438d558ae1bd5ed1087de190ce40533'
AND (
token = '/8GCzbAxY8WMNuUnlL+FqJRQUt1bieSnUQ+wRXn/ofU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)