UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rTYjN9hun8H+QMMTFtDKaOvKDnVVMDjLOr07XkBmPis='
WHERE
key_id = 'a897980b729af77911b6d69db974ba2a702492912bbdb94b5a50076c1eb20389'
AND (
token = 'rTYjN9hun8H+QMMTFtDKaOvKDnVVMDjLOr07XkBmPis='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)