UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RxYd0ByRl38B7N1SY8froLkB+X/wtl1wVMf9LAupwf0=' 
WHERE 
  key_id = '63cfcca32d6c33a420fdd0f0177814d5a93a590077d9ac646c02fae94cc91eb4' 
  AND (
    token = 'RxYd0ByRl38B7N1SY8froLkB+X/wtl1wVMf9LAupwf0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024