UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qIhhacsNEJaSQcWKIu9Avqay7oH3hmtTWD3absUZwuE=' 
WHERE 
  key_id = '7026e13601cfabd7f94bd640c3544b2e7671a4ce299da19810e5ed38a891952a' 
  AND (
    token = 'qIhhacsNEJaSQcWKIu9Avqay7oH3hmtTWD3absUZwuE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019