UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sIgeQ3mEl754ITKUivh+KoFit/77bNkShO6eNVzOv2E='
WHERE
key_id = '6796117c5131f963078d996f738a53c34d82c334d7a44120c0d47d2231ef1888'
AND (
token = 'sIgeQ3mEl754ITKUivh+KoFit/77bNkShO6eNVzOv2E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)