UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/1Ugf8964ODSWaBzSNoG+51EJgWM+Dux23DlPlKRxVI=' 
WHERE 
  key_id = 'a9ecc4e30a9b6f4f6779918f44d867d9befe5fc1dda81fdeb3bfd256cccb9c86' 
  AND (
    token = '/1Ugf8964ODSWaBzSNoG+51EJgWM+Dux23DlPlKRxVI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027