UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KUo+ME3QvisuDL2zQvkCOri7/BNInAOy55mZC9LIYbA=' 
WHERE 
  key_id = 'fde5bbef8faa9770d3c8a58b2ce7a7569cee57282af75b753f96a7fff2f96ceb' 
  AND (
    token = 'KUo+ME3QvisuDL2zQvkCOri7/BNInAOy55mZC9LIYbA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017