UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Trd+unJJqMrM/5hmhygzh+/dvimlU6s3gDWDY6p47A='
WHERE
key_id = '1141b7316199477953139fb67e50c8e07a87a5a6213f73979a1297abe9dbe2b0'
AND (
token = '/Trd+unJJqMrM/5hmhygzh+/dvimlU6s3gDWDY6p47A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)