UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jDcmeKqFcl/lbaIjZaPNZGEYGlSs41YQO7GG8thAr1I='
WHERE
key_id = 'd839b73a1cfe49c7e3097053bef8a19506336c466b9f9743cfe37ac677b0d337'
AND (
token = 'jDcmeKqFcl/lbaIjZaPNZGEYGlSs41YQO7GG8thAr1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)