UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '98EqHsoucd6l1aEie040QuDxGFC50QZF0PkUmNmMJHk=' 
WHERE 
  key_id = '4051f15f62098dc0f2ce3f20a8abedf3bfec227b9028b26dd3ef2c792f2cd416' 
  AND (
    token = '98EqHsoucd6l1aEie040QuDxGFC50QZF0PkUmNmMJHk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039