UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '99B/GCgbea4B4VdjQmEaWM2ccowOJ7OCk4jOMhi5VYI='
WHERE
key_id = 'a7e799d178016d50ab3408f96d159a462fa3561f65ff092471044c9f56b19508'
AND (
token = '99B/GCgbea4B4VdjQmEaWM2ccowOJ7OCk4jOMhi5VYI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)