UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M78OxS627Nb9UA8RQbWAGMiuVD7b0MW92nXICmANQTo=' 
WHERE 
  key_id = '8ae3e1ed7dd6b0fdcb891af013d9263bf7efdc1905af644c566e5569d448be8c' 
  AND (
    token = 'M78OxS627Nb9UA8RQbWAGMiuVD7b0MW92nXICmANQTo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039