UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G8Ei9AlH69Zr3SHBvTA6JFTpcGurmOdPfhQ5Li76+3w='
WHERE
key_id = '30e491f49bae93ada18d7cc41c063daf092dd7f4d4b6f9db05644f0dba723bdf'
AND (
token = 'G8Ei9AlH69Zr3SHBvTA6JFTpcGurmOdPfhQ5Li76+3w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)