UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'la+aNDZ7cBg7VFo87ufL+H3CAAmoWAwe2rPa46ColxI='
WHERE
key_id = 'f1ac0ca2865469ea29fa916a5ad6481fc7f4412c9579791fc7a4674743c7c0ae'
AND (
token = 'la+aNDZ7cBg7VFo87ufL+H3CAAmoWAwe2rPa46ColxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)