UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O9HoLJQCymntDQY/5TzP4KeLa6WA6swp22sVwa0qTd0='
WHERE
key_id = '848660610885ed1f5a7e61a3e622217bfbfd8ee2b1f165b7030a079bbf6353ab'
AND (
token = 'O9HoLJQCymntDQY/5TzP4KeLa6WA6swp22sVwa0qTd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)