UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ALP1i4Kq2aGg84IKHWFSSMn7Hti1gXZoKbUwPM6BBgM='
WHERE
key_id = 'cab1496efe9f19dc425be36401057d18499cb9f967e88c9b6c333ca9619801ec'
AND (
token = 'ALP1i4Kq2aGg84IKHWFSSMn7Hti1gXZoKbUwPM6BBgM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)