UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J4ep2+8Zqc5A2ETR9GUmnQ48vX4GKa5bOge5aTMT+4M='
WHERE
key_id = '88a6547ddf7ef695e7064479547f476a27eeb6bc7da342b80db8a0fffd6fa305'
AND (
token = 'J4ep2+8Zqc5A2ETR9GUmnQ48vX4GKa5bOge5aTMT+4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)