UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8xXqeNMKD7EfGy0cCv+KnQr3/rqm06txk9SavJZ6UAE='
WHERE
key_id = '33dbeae5675684e0e386a0c6837f3f999f197d53f7e98a52775c55d418707d81'
AND (
token = '8xXqeNMKD7EfGy0cCv+KnQr3/rqm06txk9SavJZ6UAE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)