UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mADVoz4cPfs/XZYiAvOHbeKXfGrN2UgiiboeFrstelc='
WHERE
key_id = '3404d48f760867658b6a97fffd6c5df41c20f620b888afab61fd59dc1699ebe7'
AND (
token = 'mADVoz4cPfs/XZYiAvOHbeKXfGrN2UgiiboeFrstelc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)