UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iglv6GkWR7qeVh+f+1iyO21bbFH3cG7UxXH7hTqdTCc=' 
WHERE 
  key_id = '2f6890565d245e95d4ddc79651a6e2677b102eb6114ada9bbe3e93b68f334062' 
  AND (
    token = 'iglv6GkWR7qeVh+f+1iyO21bbFH3cG7UxXH7hTqdTCc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041