UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DnfwRy9zF6uj7S9wRSW13y8yfR/u7W2P7O5iJmQMoC0=' 
WHERE 
  key_id = 'bf6ebf9d108a27f14d3c1cddff31d061fe5941a1d5fdd73b0c7b56d335bc9b6a' 
  AND (
    token = 'DnfwRy9zF6uj7S9wRSW13y8yfR/u7W2P7O5iJmQMoC0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030