UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FoEw5r+UuR8hEhqvAIH4fXusi/cTX68LvEKxtz314WU=' 
WHERE 
  key_id = 'aa527a848137ee6ee96ec1b16089468cbd1f26380fa392d17e06115ed1e578ab' 
  AND (
    token = 'FoEw5r+UuR8hEhqvAIH4fXusi/cTX68LvEKxtz314WU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017