UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YAdJZgs3235goR7IIxDEKK5Q/A6iu6d/N9b5EtnDhJE='
WHERE
key_id = 'a7b8108f3d0cf0f0c10f4e25bff4c66a0f95b770e58d4f68e20863d54a35fa34'
AND (
token = 'YAdJZgs3235goR7IIxDEKK5Q/A6iu6d/N9b5EtnDhJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)