UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rrUjqsp7CfeOuLs+hjXjaRbAAFS/2nQho2APyppAuLA='
WHERE
key_id = '1d640259b286c66bcb916881e188ce942ac358fa148181892e37712865274203'
AND (
token = 'rrUjqsp7CfeOuLs+hjXjaRbAAFS/2nQho2APyppAuLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)