UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bMyykP1FNa5h52aXHA8I/4BOB8tum2PhLFUNnethk38='
WHERE
key_id = '8ab45a8ede7f6f08f25d44426b33c806758bf9a3de333a3a64c5d48c35c0d259'
AND (
token = 'bMyykP1FNa5h52aXHA8I/4BOB8tum2PhLFUNnethk38='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)