UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cl+5IlHzF3GlGzQIHMdpIrD64g7C1JnG7ceRNcgNwpA=' 
WHERE 
  key_id = '25c8e9fb429d3b6c6e34b9400d07a76aa68d77eb183958c530ac415d89ebf7c1' 
  AND (
    token = 'Cl+5IlHzF3GlGzQIHMdpIrD64g7C1JnG7ceRNcgNwpA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045