UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2O6DscQ6vs94GV8OWlv0slEb/K9syJRxvUroF5sKbGU=' 
WHERE 
  key_id = 'f9c5d00be0ddd288e24715dbfc9d8284df462335fc2885aa0d6bb772bd715148' 
  AND (
    token = '2O6DscQ6vs94GV8OWlv0slEb/K9syJRxvUroF5sKbGU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040