UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Q/FAndpnfUfh2LyJ581jEk78lJUo7Y/3VLAewCnpqc='
WHERE
key_id = '14babe9b7612668ef872f932efca87decbbcd97dedb8917eabf7dc05e3e8a9b4'
AND (
token = '1Q/FAndpnfUfh2LyJ581jEk78lJUo7Y/3VLAewCnpqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)